package com.itheima.mapper;

import com.itheima.pojo.Emp;
import com.itheima.pojo.EmpQueryParam;
import org.apache.ibatis.annotations.*;

import java.util.List;
@Mapper
public interface EmpMapper {

    List<Emp> selectPage(EmpQueryParam empQueryParam);
//    @Select("select * from emp where id=#{id}")
//    Emp getById(Integer id);
//    @Update("update emp set username=#{username},name=#{name},gender=#{gender},phone=#{phone},job=#{job},entrydate=#{entrydate},dept_id=#{deptId} where id=#{id}")
//    void update(Emp emp);
    @Options(useGeneratedKeys = true,keyProperty = "id")
    @Insert("insert into emp(username,password,name,gender,phone,job,salary,image,entry_date,dept_id,create_time,update_time) "
            +"values(#{username},#{password},#{name},#{gender},#{phone},#{job},#{salary},#{image},#{entryDate},#{deptId},#{createTime},#{updateTime})")
    void add(Emp emp);
}
